package com.navi.core.util;

import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

/**
 * Created by jay on 2018/1/23.
 */
public class SqlUtil {

    public static String set2InCondition(Set<String> mySet) {
        StringBuffer inSb = new StringBuffer();

        if (!mySet.isEmpty()) {
            mySet.forEach(s -> inSb.append("'").append(s).append("',"));
            return inSb.substring(0, inSb.length() - 1);
        } else {
            return "";
        }
    }

    public static void main(String[] args) {
        Set<String> glassSet = ConcurrentHashMap.newKeySet();
        glassSet.add("123");
//        glassSet.add("1we");
//        glassSet.add("asd");
//        glassSet.add("uuu");
        System.out.println(set2InCondition(glassSet));
    }
}
